class Task58_2:
    def run(self, string, n):
        array = list(string)
        self.flip_array(array, 0, len(array))
        self.flip_array(array, 0, len(array) - n)
        self.flip_array(array, len(array) - n, len(array))
        return ''.join(array)

    def flip_array(self, array, start, end):
        start_index = start
        end_index = end - 1
        while start_index < end_index:
            array[start_index], array[end_index] = array[end_index], array[start_index]
            start_index += 1
            end_index -= 1
